﻿<?php 
	$path = "../";
	include_once($path.'configuration.php');
	/*Traitements*/
	include_once($path.'head.php');	
?>
	<div id="bodyWrapper">
		<h1>GESTION DES INCIDENTS !</h1>
		<a href="<?php echo $path; ?>administration/add_incident.php">AJOUTER</a>
		<table>
			<tr>
				<th>
					ID
				</th>
				<th>
					MACHINE
				</th>
				<th>
					TYPE
				</th>
				<th>
					COMPLEMENT
				</th>
				<th>
					DATE DETECTION
				</th>
				<th>
					DATE RESOLUTION
				</th>
				<th>
				</th>
				<th>
				</th>
			</tr>
			<?php
				$liste_incidents = $dbh->getAllIncident();
				//var_dump($liste_incidents);// permet de voir les informations qui devra etre afficher par la valeur $liste_incidents.
				foreach($liste_incidents as $listes){
			?>
			<tr>
				<td>
					<?php echo $listes['id_incident']; ?>
				</td>
				<td>
					<?php 
					$machining = new machine($dbh, $listes['machine']);
					echo $machining->getNom();
					?>
				</td>
				<td>
					<?php 
					$typing = new Type_Incident($dbh, $listes['type']);
					echo $typing->getName();
					?>
				</td>
				<td>
					<?php echo $listes['complement']; ?>
				</td>
				<td>
					<?php echo $listes['date_detection']; ?>
				</td>
				<td>
					<?php echo $listes['date_resolution']; ?>
				</td>
				<td>
					<a href="<?php echo $path; ?>administration/add_incident.php?action=modif&incident=<?php echo $listes['id_incident'];?>"> MODIFIER </a>
				</td>
				<td>
					<a onclick="return confirm(' En Etes-Vous Certain ? ');" href="<?php echo $path; ?>administration/add_incident.php?action=delete&incident=<?php echo $listes['id_incident'];?>"> SUPPRIMER </a>
				</td>
			</tr>
			<?php
				}
			?>
		</table>
	</div>
<?php
	include_once($path.'footer.php');
?>